package ovm.gui.views.catalogs;

import ovm.gui.views.AbstractCatalogView;
import ovm.management.AbstractManager;

/**
 * Created by IntelliJ IDEA.
 * User: Jokser
 * Date: 08.06.12
 * Time: 4:48
 * To change this template use File | Settings | File Templates.
 */
public class TimeCatalogView extends AbstractCatalogView {
    public TimeCatalogView(Class entityClass, Boolean editable) {
        super(entityClass, editable);
        setCaption("Времена занятий");
    }
    
    @Override
    protected int addNewEntity() {
        return AbstractManager.addDefaultEntity(entityClass);
    }
    
    @Override
    protected void setContainerProperties() {
        entityContainer.addContainerProperty("id", Integer.class, null, true, true);
        entityContainer.addContainerProperty("timeStart", String.class, "", true, true);
        entityContainer.addContainerProperty("timeEnd", String.class, "", true, true);
    }

    @Override
    protected void buildTable() {
        table.setVisibleColumns(new Object[]{"id", "timeStart", "timeEnd"});
        table.setColumnHeaders(new String[]{"ID", "Время начала", "Время конца"});
    }
}
